package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Users struct {
	Id         int
	Username   string        `ht:"list;search;name(用户名)"  valid:"Required"`
	Password   string        `ht:"hide;name(密码)"  valid:"Required"`
	UserType   int                `ht:"list;name(用户类型);subclass([{\"Num\":0,\"Name\":\"普通用户\"},{\"Num\":1,\"Name\":\"楼层负责人\"},{\"Num\":10,\"Name\":\"小区负责人\"},{\"Num\":11,\"Name\":\"消防人员\"},{\"Num\":12,\"Name\":\"片区负责人\"},{\"Num\":100,\"Name\":\"管理员\"}])"`
	WXOpenId   string        `ht:"name(微信OpenId)"`
	WXToken    string        `ht:"name(微信Token)"`
	Email      string        `ht:"list;name(邮箱)"`
	Phone      string        `ht:"list;name(手机号)"  valid:"Mobile"`
	CreateTime time.Time        `ht:"name(创建时间)"`
	UpdateTime time.Time        `ht:"name(资料更新时间)"`
	Age        int                `ht:"name(年龄)"`
	Sex        string        `ht:"name(性别);enum([{\"Key\":\"男\",\"Value\":\"男\"},{\"Key\":\"女\",\"Value\":\"女\"}])"`
	Labels     string        `ht:"name(标签)"`
	Rank       int                `ht:"name(级别)"`
	Mark       int                `ht:"name(积分)"`
	CityName   string        `ht:"name(所属地区)" valid:"Required"`
	CityId     int                `ht:"name(所属地区ID)" valid:"Required"`
}

func init() {
	orm.RegisterModel(new(Users))
}
func (*Users)TableName() string {
	return "users"
}

func (*Users) FN_Id() string {
	return "Id"
}
func (*Users) FN_Username() string {
	return "Username"
}
func (*Users) FN_Password() string {
	return "Password"
}
func (*Users) FN_UserType() string {
	return "UserType"
}
func (*Users) FN_WXOpenId() string {
	return "WXOpenId"
}
func (*Users) FN_WXToken() string {
	return "WXToken"
}
func (*Users) FN_Email() string {
	return "Email"
}
func (*Users) FN_Phone() string {
	return "Phone"
}
func (*Users) FN_CreateTime() string {
	return "CreateTime"
}
func (*Users) FN_UpdateTime() string {
	return "UpdateTime"
}
func (*Users) FN_Age() string {
	return "Age"
}
func (*Users) FN_Sex() string {
	return "Sex"
}
func (*Users) FN_Labels() string {
	return "Labels"
}
func (*Users) FN_Rank() string {
	return "Rank"
}
func (*Users) FN_Mark() string {
	return "Mark"
}
func (*Users) FN_CityName() string {
	return "CityName"
}
func (*Users) FN_CityId() string {
	return "CityId"
}